package com.jeework.common.utils;

import com.github.pagehelper.PageInfo;
import com.jeework.common.entity.Page;

public class PageUtil {

    public static void transferPage(Page page,PageInfo pageInfo) {
        if (null != page && null != pageInfo) {
            page.setList(pageInfo.getList());
            page.setPageNo(pageInfo.getPageNum());
            page.setPageSize(pageInfo.getPageSize());
            page.setCount(pageInfo.getTotal());
            page.setPrev(pageInfo.getPrePage());
            page.setNext(pageInfo.getNextPage());
            page.setFirst(pageInfo.getNavigateFirstPage());
            page.setLast(pageInfo.getNavigateLastPage());
        }
    }
}
